package com.loan.market.util

import com.loan.market.bean.User

object UserUtil {

    fun isLogin(): Boolean {
        return getUserId().isNotEmpty()
    }

    fun logout() {
        return SPUtil.putObject("user", null)
    }

    fun login(user: User?) {
        return SPUtil.putObject("user", user)
    }

    fun getUserId(): String {
        return SPUtil.getObject<User>("user")?.userId ?: ""
    }

}